import request from '@/utils/request'
import type { QuestionParams, QuestionList, QuestionItem, LikeArticleData } from '@/types/data'

// 获取数据列表
export const getArticleList = (params: QuestionParams) => {
  return request<QuestionList>('interview/query', 'GET', params)
}
// 获取文章详情
export function getAricleInfo(query: { id: string }) {
  return request<QuestionItem>('interview/show', 'get', query)
}
// 收藏 点赞文章
export function LikeArticle(data: { id: string; optType: 1 | 2 }) {
  return request('interview/opt', 'POST', data)
}
// 获取点赞/收藏页面
export function getLikeCollectList(params: LikeArticleData) {
  return request<QuestionList>('interview/opt/list', 'GET', params)
}
